﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace XDesigner.Writer.Test
{
    public partial class dlgStartOptions : Form
    {
        public dlgStartOptions()
        {
            InitializeComponent();
            this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
        }


        private void dlgStartOptions_Load(object sender, EventArgs e)
        {
            if (_StartOptions == null)
            {
                _StartOptions = new AppStartOptions();
            }
            chkDoubleBuffer.Checked = _StartOptions.DoubleBuffering;
            chkEnablePermissionControl.Checked = _StartOptions.EnablePermissionControl;
        }

        private AppStartOptions _StartOptions = null;

        public AppStartOptions StartOptions
        {
            get { return _StartOptions; }
            set { _StartOptions = value; }
        }

        private void btnStart_Click(object sender, EventArgs e)
        {
            _StartOptions = new AppStartOptions();
            _StartOptions.DoubleBuffering = chkDoubleBuffer.Checked;
            _StartOptions.EnablePermissionControl = chkEnablePermissionControl.Checked;
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

    }
}
